package com.csproj.system.repository;

import com.csproj.system.domain.Language;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface LanguageRepository extends JpaRepository<Language,Long> {

    @Query(" from Language  where isDefault = true ")
    List<Language> findByDefault();

    Language findByName(String Name);

    @Modifying
    @Query(" update Language set isDefault = false ")
    void updateNotDefault();
}
